<include file="public@header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a>退款列表</a></li>
		</ul>

		<form class="well form-inline margin-top-20" method="post" action="{:url('Refundlist/index')}">

			退款状态：
            <select class="form-control" name="status">
				<option value="">默认</option>
                <volist name="status" id="v">
                    <option value="{$key}" <if condition="input('request.status') neq '' && input('request.status') eq $key">selected</if>>{$v}</option>
                </volist>
			</select>

			订单类型：
			<select class="form-control" name="goods_type" >
				<option value="">全部</option>
				<option value="0" <if condition="input('request.goods_type') neq '' && input('request.goods_type') eq 0">selected</if>>卖家发布</option>
				<option value="1" <if condition="input('request.goods_type') neq '' && input('request.goods_type') eq 1">selected</if>>平台自营</option>

					
			</select>

            买家用户ID：
            <input class="form-control" type="text" name="buyer_uid" style="width: 200px;" value="{:input('request.buyer_uid')}"
                   placeholder="请输入买家用户ID、靓号">

            卖家用户ID：
            <input class="form-control" type="text" name="seller_uid" style="width: 200px;" value="{:input('request.seller_uid')}"
                   placeholder="请输入卖家用户ID、靓号">

            退款申请时间：
			<input class="form-control js-bootstrap-date" name="start_time" id="start_time" autocomplete="off" value="{:input('request.start_time')}" aria-invalid="false" style="width: 110px;"> - 
            <input class="form-control js-bootstrap-date" name="end_time" id="end_time" autocomplete="off" value="{:input('request.end_time')}" aria-invalid="false" style="width: 110px;">
                        
			<input type="submit" class="btn btn-primary" value="搜索">
			<a class="btn btn-danger" href="{:url('Refundlist/index')}">清空</a>
		</form>

		<form method="post" class="js-ajax-form" action="">
		
			<table class="table table-hover table-bordered">
				<thead>
					<tr>
					  	
						<th>订单ID</th>
						<th>订单编号</th>
						<th>买家信息</th>
						<th>卖家信息</th>
						<th>退款原因</th>
						<th>退款说明</th>
						<th>退款类型</th>
						<th>申请时间</th>
						<th>店铺处理结果</th>
						<th>店铺处理时间</th>
						<th>店铺驳回次数</th>
						<th>是否平台介入</th>
						<th>申请平台介入理由</th>
						<th>申请平台介入说明</th>
						<th>申请平台介入图片</th>
						<th>平台处理结果</th>
						<th>平台处理时间</th>
						<th>平台处理账号</th>
						<th>平台处理IP</th>
						<th>系统自动处理时间</th>
						<th>退款处理状态</th>
						<th align="center">{:lang('ACTIONS')}</th>
					</tr>
				</thead>
				<tbody>
					<foreach name="lists" item="vo">
					<tr>
					   
						<td>{$vo.orderid}</td>
						<td>{$vo.orderno}</td>
						<td>{$vo['buyer_info']['user_nickname']}({$vo.uid})</td>
						<td>
							<if condition="$vo['shop_uid'] eq 1">
								平台自营
							<else />
								{$vo['seller_info']['user_nickname']}({$vo.shop_uid})
							</if>
						</td>
						<td>{$vo['reason']}</td>
						<td>{$vo['content']}</td>
						<td>{$type[$vo['type']]}</td>
						<td>{:date('Y-m-d H:i',$vo['addtime'])}</td>
						<td>{$shop_result[$vo['shop_result']]}</td>
						<td><if condition="$vo.shop_process_time gt 0">{:date('Y-m-d H:i',$vo['shop_process_time'])}</if></td>
						<td>{$vo['shop_process_num']}</td>
						<td><if condition="$vo.is_platform_interpose eq 0">否<else />是</if></td>
						<td>{$vo['platform_interpose_reason']}</td>
						<td>{$vo['platform_interpose_desc']}</td>
						<td>
							<if condition="$vo['platform_interpose_thumb'] neq ''">
								<img width="40" src="{$vo['platform_interpose_thumb']}" class="imgtip" />
							</if>
						</td>
						<td>{$platform_result[$vo['platform_result']]}</td>
						<td><if condition="$vo.platform_process_time gt 0">{:date('Y-m-d H:i',$vo['platform_process_time'])}</if></td>
						<td>{$vo['admin']}</td>
						<td><if condition="$vo.ip gt 0">{:long2ip($vo['ip'])}<else />--</if></td>
						<td><if condition="$vo['system_process_time'] neq ''">
								{:date('Y-m-d H:i',$vo['system_process_time'])}
							</if>
                        </td>
                        <td>{$status[$vo['status']]}</td>
						
						<td>

							<if condition="$vo['status'] eq 0 and $vo['shop_result'] eq 0 and $vo['shop_process_num']<3 and $vo['shop_uid'] eq 1">

                            	<a class="btn btn-xs btn-danger" href='{:url("Refundlist/platformedit",array("id"=>$vo["id"]))}'>平台自营处理退款</a>

                            </if>

                            <if condition="$vo['status'] eq 0 and $vo['is_platform_interpose'] eq 1">

                            	<a class="btn btn-xs btn-danger" href='{:url("Refundlist/edit",array("id"=>$vo["id"]))}'>平台介入处理</a>

                            </if>
                           
                            <!-- <a class="btn btn-xs btn-primary" onclick="refundHistory({$vo['orderid']})">协商历史</a> -->
                            <a class="btn btn-xs btn-primary" onclick="refundHistory({$vo['orderid']})">协商历史</a>
							<!-- <a class="btn btn-xs btn-danger js-ajax-delete" href="{:url('Refundlist/del',array('id'=>$vo['id']))}">{:lang('DELETE')}</a> -->
						</td>
					</tr>
					</foreach>
				</tbody>
			</table>
			<div class="pagination">{$page}</div>
		</form>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
	<script type="text/javascript">
		$(function(){
			Wind.use('layer');
		});


		function refundHistory(orderid){

		
			layer.open({
			  type: 2,
			  title: '协商历史',
			  shadeClose: true,
			  shade: 0.8,
			  area: ['500px', '90%'],
			  content: '/appapi/Goodsorderrefund/index?user_type=platform&orderid='+orderid
			}); 
		}
	</script>
</body>
</html>